#pragma once

// Copyright (c) 2010 Manuel Peinado Gallego <manuel.peinado@gmail.com>
// Distributed under the MIT license

#include <alg3d/alg3d.h>
class Ray;
class AABB;

class Sphere
{
public:

    Sphere(const gx::Vec3 & c=gx::zero, double r=0.);
    gx::Vec3 center;
    double radius;

    AABB getAabb() const;

    bool rayIntersection(const Ray & ray, double & dist2, gx::Vec3 & inter) const;
};

Sphere applyTransform(const Sphere & sph, const gx::Mat4 & m);